<template>
  <view class="container">
    <NavBar
      :title="formPage == 'drafts' ? '草稿详情' : '发起活动'"
      :del="false"
      @clickLeftFn="clickLeftFn"
      @clickRightFn="clickRightFn"
      :iconClass="formPage == 'drafts' ? '' : 'icon-lishijilu'"
    />
    <view class="container-item">
      <uni-forms
        ref="baseForm"
        :modelValue="baseFormData"
        labelWidth="100px"
        label-position="left"
      >
        <uni-forms-item label="活动类型" required>
          <uni-data-select
            v-model="baseFormData.activityType"
            clear
            :localdata="range"
            placeholder="请选择"
            placeholder-style="color: #999"
          >
          </uni-data-select>
        </uni-forms-item>

        <uni-forms-item label="活动主题" required class="change_style">
          <uni-easyinput
            style="padding-right: 16rpx; box-sizing: border-box"
            type="text"
            v-model="baseFormData.activityTheme"
            placeholder="请填写"
            placeholder-style="color: #999"
          />
        </uni-forms-item>

        <!-- 开始时间，大于当前时间， 结束时间，大于结束时间 -->
        <uni-forms-item label="开始时间" required>
          <uni-datetime-picker
            type="datetime"
            :start="time"
            :clear-icon="false"
            return-type="timestamp"
            :border="false"
            v-model="baseFormData.activityStartTime"
            @click="chuanci()"
            @change="changeStart"
            placeholder="请选择"
            placeholder-style="color: #999"
          />
          <!-- :hide-second="true" -->
        </uni-forms-item>

        <uni-forms-item label="结束时间" required>
          <uni-datetime-picker
            type="datetime"
            :start="endtime"
            :clear-icon="false"
            return-type="timestamp"
            v-model="baseFormData.activityEndTime"
            :border="false"
            @click="chuanci()"
            @change="changeEnd"
            placeholder="请选择"
            placeholder-style="color: #999"
          />
        </uni-forms-item>

        <uni-forms-item label="活动地点" required>
          <uni-data-select
            v-model="baseFormData.activityPlace"
            :localdata="range2"
            @click="chuanci2"
            placeholder="请选择"
            placeholder-style="color: #999"
          >
          </uni-data-select>
        </uni-forms-item>

        <uni-forms-item
          label="参与人员"
          required
          style="
            text-align: right;
            position: relative;
            padding-right: 10rpx;
            color: #ccc;
          "
        >
          <text @click="choosePeole" style="color: #999">请选择</text>
        </uni-forms-item>
        <!-- {{personnel}} -->
        <view class="people_text" v-show="personnel.length">
          <view v-for="(i, index) in personnel" :key="index">
            {{ i.name }}
          </view>
        </view>

        <uni-forms-item label="活动内容" required> </uni-forms-item>
        <view class="textarea_con">
          <textarea
            type="textarea"
            style="background: #f3f5f8"
            class="textarea_text"
            :maxlength="500"
            placeholder-class="textarea_plac"
            v-model="baseFormData.activityContent"
            placeholder="请输入"
            placeholder-style="color: #999"
          />
          <text class="text_num"> {{ textLength }}/500</text>
        </view>

        <uni-forms-item label="封面" class="cover_img">
          <view class="upload_btn" @click="uploadImg">
            <view
              class="upload_text"
              :style="
                baseFormData.coverUrl.length ? 'color: #fff' : 'color: #0b847b;'
              "
            >
              <i
                class="iconfont icon-xiangji1fill"
                style="font-size: 45rpx"
              ></i>
              <view
                >{{ baseFormData.coverUrl.length ? "更换" : "上传" }}图片</view
              >
            </view>
            <view v-for="(i, index) in baseFormData.coverUrl" :key="index">
              <image :src="i" style="width: 200rpx; height: 132rpx"> </image>
            </view>
          </view>
        </uni-forms-item>

        <view class="upload_file">
          <uni-forms-item label="附件" required> </uni-forms-item>
          <lsj-upload
            style="
              width: 20%;
              height: 80rpx;
              text-align: right;
              padding-top: 20rpx;
              box-sizing: border-box;
            "
            ref="lsjUpload"
            childId="upload1"
            :size="uploadconfig2.size"
            :instantly="uploadconfig2.instantly"
            :formats="uploadconfig2.formats"
            :option="option"
            @change="onChange"
            @uploadEnd="onuploadEnd"
            @progress="onProgress"
            @fail="failFile"
          >
            <view
              style="width: 100%; text-align: right; color: #0b847b"
              @click="fuckyou"
            >
              <i
                class="iconfont icon-24gf-folderOpen"
                style="color: #0b847b"
              ></i>
              上传
            </view>
          </lsj-upload>
        </view>
        <progress
          v-if="percent != 0 && percent != 100"
          :percent="percent"
          show-info
          stroke-width="3"
        />

        <view v-if="baseFormData.accessoryUrl.length">
          <view
            class="file_list"
            v-for="(item, index) in baseFormData.accessoryUrl"
            :key="index"
          >
            <view @click="prevFileClick(item)" class="file_list_item">
              <view>
                <i
                  class="iconfont icon-24gf-folderOpen"
                  style="color: #0b847b"
                ></i>
                {{ item.accessoryName }}</view
              >
            </view>
            <view class="iconfont icon-close" @click="delFile(index)"></view>
          </view>
        </view>

        <view style="padding-top: 20px"></view>
        <view class="btns">
          <button
            v-if="formPage != 'drafts'"
            class="save-draft"
            :disabled="disabledDraft"
            :loading="draftLoading"
            @click="saveDraft(0)"
          >
            保存至草稿
          </button>
          <button
            class="publish"
            :style="formPage == 'drafts' ? 'width:700rpx' : ''"
            :disabled="disabledPublish"
            :loading="publishLoading"
            @click="saveDraft(1)"
          >
            发布通知
          </button>
        </view>
        <view style="padding-top: 20px"></view>
      </uni-forms>
    </view>
  </view>
</template>

<script>
// 接口
import {
  getJoinUser,
  saveDrafts, // 保存草稿箱
  sendActivity, // 发起活动
  apiHuoDongTongZhi, // 19 党群活动通知 / status 0未读 2已读 /  uid
} from "../../net/dagnqunhuodong.js";

import {
  prevFile, // 预览文件
} from "../../utils/preview.js";
import { previewPic, timestampToTime, format } from "../../utils/fun.js";
import { serverUrl2, uploadconfig2 } from "../../const";

import NavBar from "@/components/NavBar.vue";
export default {
  components: {
    NavBar,
  },
  data() {
    return {
      uploadconfig2,
      option: {
        url: uploadconfig2.url,
        name: "file",
        header: {
          Authorization: uni.getStorageSync("token"),
          platform: "APP",
        },
        formData: {},
      },
      percent: 0,
      // 开始时间和结束时间限制
      // isHideFile:true,
      time: "",
      endtime: "",
      uploadURL: "/masses/common/upload", // 上传接口地址
      formPage: "", // 来自哪个页面
      visible: false,
      choosePeoName: [],
      range2: [], //活动地点
      isFlag: true,
      disabledDraft: false,
      draftLoading: false,
      disabledPublish: false,
      publishLoading: false,
      tabIndex: 0,
      // 文件回显列表
      files: new Map(),
      // 参与人员
      personnelArr: [],
      personnel: [], // 选择的参与人员
      // 活动类型
      range: [],
      typeClassArr: [],
      suffix: "", //后缀名
      baseFormData: {
        activityTheme: "",
        activityType: "",
        activityStartTime: "",
        activityEndTime: "",
        participant: [],
        activityContent: "",
        coverUrl: [],
        accessoryUrl: [],
        activityPlace: "",
        userId: JSON.parse(uni.getStorageSync("loginUserInfo")).uid,
        djDeptId: JSON.parse(uni.getStorageSync("loginUserInfo")).djDeptId,
      },
    };
  },

  computed: {
    textLength() {
      if (this.baseFormData.activityContent.length) {
        return this.baseFormData.activityContent.length;
      } else {
        return 0;
      }
    },
  },
  onShow() {
    let djDeptId = JSON.parse(uni.getStorageSync("loginUserInfo")).djDeptId;
    this._getJoinUser(djDeptId); // 获取选择的参与人员
    if (uni.getStorageSync("participant")) {
      this.personnel = JSON.parse(uni.getStorageSync("participant"));
    } else {
      this.personnel = [];
    }
  },
  onLoad() {
    this.baseFormData = {
      activityTheme: "",
      activityType: "",
      activityStartTime: "",
      activityEndTime: "",
      participant: [],
      activityContent: "",
      coverUrl: [],
      accessoryUrl: [],
      activityPlace: "",
      userId: JSON.parse(uni.getStorageSync("loginUserInfo")).uid,
      djDeptId: JSON.parse(uni.getStorageSync("loginUserInfo")).djDeptId,
    };
    this.baseFormData.coverUrl = [];

    this.time = timestampToTime();
    // 活动类型
    this.range = JSON.parse(uni.getStorageSync("typeClassArr")).map((v) => {
      return {
        value: v.enumId,
        text: v.name,
      };
    });
    // 活动地点
    this.range2 = JSON.parse(uni.getStorageSync("activityPlaceArr"));

    // this.getApiChamberList();
    setTimeout(() => {
      this.fuckyou();
    }, 1000);

    // 从草稿箱跳转来
    let itemParams;
    if (uni.getStorageSync("itemParams")) {
      itemParams = this.baseFormData = JSON.parse(
        uni.getStorageSync("itemParams")
      );
      this.baseFormData.accessoryUrl = JSON.parse(itemParams.accessoryUrl);
      this.baseFormData.activityPlace = Number(this.baseFormData.activityPlace);
      this.formPage = itemParams.formPage; // 来自哪个页面

      console.log(itemParams);
      let arr = JSON.parse(itemParams.participant);
      setTimeout(() => {
        this.personnel = arr;
        uni.setStorageSync("participant", JSON.stringify(arr));
      }, 0);
      console.log(this.personnel);
      setTimeout(() => {}, 500);
      // this.baseFormData.participant = [];
    }
  },
  methods: {
    // 跳转页面,选择参与人员
    choosePeole() {
      this.$refs.lsjUpload && this.$refs.lsjUpload.show();
      this.$forceUpdate();
      uni.navigateTo({
        url: `./choosePeople?personnelArr=${JSON.stringify(this.personnelArr)}`,
      });
    },

    // 预览上传的文件
    prevFileClick(item) {
      prevFile(item);
    },

    uniShowToast(title, icon = "error") {
      uni.showToast({
        title,
        icon,
      });
    },

    // 上传照片
    // 上传封面
    uploadImg() {
      uni.chooseImage({
        count: 1,
        sizeType: ["original", "compressed"], //可以指定是原图还是压缩图，默认二者都有
        sourceType: ["album", "camera"], //从相册选择
        success: (res) => {
          uni.showLoading({
            title: "上传中……",
          });
          this.baseFormData.coverUrl = [];
          uni.uploadFile({
            url: `https://${serverUrl2}${this.uploadURL}`,
            filePath: res.tempFilePaths[0],
            name: "file",
            header: {
              Authorization: uni.getStorageSync("token"),
              platform: "APP",
            },
            success: (res) => {
              uni.hideLoading();
              let data = JSON.parse(res.data);
              if (data.code === 0) {
                uni.showToast({
                  title: "上传成功",
                  duration: 1000,
                  icon: "success",
                  mask: true,
                });
                this.baseFormData.coverUrl.push(data.data.url);
              } else {
                uni.showToast({
                  title: "上传失败",
                  duration: 1000,
                  icon: "error",
                  mask: true,
                });
              }
            },
            file: (err) => {
              console.log(err);
              uni.showToast({
                title: "上传失败",
                duration: 1000,
                icon: "error",
                mask: true,
              });
            },
          });
        },
        file: (err) => {
          console.log(err);
          uni.hideLoading();
        },
      });
    },

    // 删除图片地址
    changePic() {
      this.baseFormData.coverUrl = [];
    },

    // 预览 图片
    prePic(url) {
      let arr = [url];
      previewPic(arr);
    },

    // 判断开始时间和结束时间
    changeStart(e) {
      this.endtime = format(e);
    },
    changeEnd(e) {
      // this.endtime = format(e);
    },

    bindPickerChange(e) {
      this.visible = !this.visible;
      let index = e.detail.value;
    },

    // 删除附件
    delFile() {
      for (let i = 0; i < this.baseFormData.accessoryUrl.length; i++) {
        this.baseFormData.accessoryUrl.splice(i, 1);
      }
      this.fuckyou();
    },

    // 获取参与人员
    _getJoinUser(djDeptId) {
      getJoinUser(djDeptId)
        .then((res) => {
          this.personnelArr = res.data.map((v) => {
            return {
              value: v.id,
              text: v.name,
              phone: v.phone,
              flag: false,
            };
          });
        })
        .catch((err) => {});
    },
    // 穿刺一击让他们的遮罩层消失
    chuanci() {
      this.$refs.lsjUpload && this.$refs.lsjUpload.hide();
    },
    // 穿刺一击让他们的遮罩层消失
    chuanci2() {
      this.$refs.lsjUpload && this.$refs.lsjUpload.show();
      this.$forceUpdate();
    },
    fuckyou() {
      console.log(this.$refs.lsjUpload);
      this.$refs.lsjUpload && this.$refs.lsjUpload.hide();
      this.$refs.lsjUpload && this.$refs.lsjUpload.show();
      this.$forceUpdate();
    },

    // 上传附件的操作
    // 选择文件后触发
    selectPic(file) {
      let that = this;
      uni.uploadFile({
        url: `https://${serverUrl2}${this.uploadURL}`,
        filePath: file.tempFilePaths[0],
        name: "file",
        header: {
          Authorization: uni.getStorageSync("token"),
          platform: "APP",
        },
        success(res) {
          let data = JSON.parse(res.data);
          that.baseFormData.coverUrl.push(data.data.url);
        },
        file(err) {
          console.log(err);
        },
      });
    },
    // 文件上传时触发
    picProgress(file) {
      console.log(file);
    },
    // 上传成功触发
    successPic(file) {
      console.log(file);
    },
    // 上传失败触发
    failPic(file) {
      console.log(file);
      uni.hideLoading();
    },
    // 文件从列表移除时触发
    deletePic(file) {
      console.log(file);
    },

    onProgress(res) {
      this.percent = res.progress;
      console.log(res);
    },

    // 上传文件的操作
    // 选择文件触发，返回所有已选择文件Map集合
    onChange(files) {
      this.files = files;
      this.$forceUpdate();
    },
    failFile() {
      uni.showToast({
        title: "上传失败",
        icon: "error",
        mask: true,
        duration: 1500,
      });
    },
    // 上传结束回调，返回参数与progress一致
    onuploadEnd(item) {
      let res = JSON.parse(item.responseText);

      if (res.code === 0) {
        this.baseFormData.accessoryUrl.push({
          accessoryUrl: JSON.parse(item.responseText).data.url,
          accessoryName: item.name,
        });
        this.suffix = item.name.substring(item.name.lastIndexOf(".") + 1);
      }
      console.log(`${item.name}已上传结束，上传状态=${item.type}`);

      // 更新当前窗口状态变化的文件
      this.files.set(item.name, item);

      // ---可删除--演示上传完成后取服务端数据
      if (item["responseText"]) {
        this.files.get(item.name).responseText = JSON.parse(item.responseText);
      }

      // 微信小程序Map对象for循环不显示，所以转成普通数组，
      // 如果你用不惯Map对象，也可以像这样转普通数组，组件使用Map主要是避免反复文件去重操作
      // #ifdef MP-WEIXIN
      this.wxFiles = [...this.files.values()];
      // #endif

      // 强制更新视图
      this.$forceUpdate();

      // ---可删除--演示判断是否所有文件均已上传成功
      let isAll = [...this.files.values()].find(
        (item) => item.type !== "success"
      );
      if (!isAll) {
        console.log("已全部上传完毕");
      } else {
        console.log(isAll.name + "待上传");
      }
    },

    // 发布活动通知
    sendHuoDongTongZhi() {
      let data = {
        status: 0,
        uid: JSON.parse(uni.getStorageSync("loginUserInfo")).uid,
      };
      apiHuoDongTongZhi(data)
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },

    // 提交数据
    subInputInfo(e) {
      console.log(e);
      let self = this;
      self.baseFormData.activityStartTime = format(
        self.baseFormData.activityStartTime
      );
      self.baseFormData.activityEndTime = format(
        self.baseFormData.activityEndTime
      );

      console.log(self.baseFormData.activityStartTime);
      console.log(self.baseFormData.activityEndTime);

      self.baseFormData.participant = JSON.stringify(
        self.baseFormData.participant
      );
      self.baseFormData.coverUrl = JSON.stringify(self.baseFormData.coverUrl);
      self.baseFormData.accessoryUrl = JSON.stringify(
        self.baseFormData.accessoryUrl
      );

      self.baseFormData.djDeptId = JSON.parse(
        uni.getStorageSync("loginUserInfo")
      ).djDeptId;

      if (e == 0) {
        self.disabledDraft = self.draftLoading = true;
        // 保存草稿箱
        saveDrafts(self.baseFormData)
          .then((res) => {
            self.disabledDraft = self.draftLoading = false;
            uni.removeStorage({
              key: "itemParams",
            });
          })
          .catch((err) => {
            console.log(err);
            self.disabledDraft = self.draftLoading = false;
          });
        self.personnelArr = [];
        self.personnel = [];
        self.baseFormData = {
          activityTheme: "",
          activityType: "",
          activityStartTime: "",
          activityEndTime: "",
          participant: [],
          activityContent: "",
          coverUrl: [],
          accessoryUrl: [],
          activityPlace: "",
        };
        self.clickLeftFn();
        // 跳转草稿箱
        uni.navigateTo({
          url: "../DJinitiateActivitiesDrafts/index",
        });
      } else {
        self.disabledPublish = self.publishLoading = true;
        // 发起活动
        sendActivity(self.baseFormData)
          .then((res) => {
            console.log(res);
            self.disabledPublish = self.publishLoading = false;
            uni.removeStorage({
              key: "itemParams",
            });
            self.sendHuoDongTongZhi();
          })
          .catch((err) => {
            console.log(err);
            self.disabledPublish = self.publishLoading = false;
          });
        self.personnelArr = [];
        self.personnel = [];
        self.baseFormData = {
          activityTheme: "",
          activityType: "",
          activityStartTime: "",
          activityEndTime: "",
          participant: [],
          activityContent: "",
          coverUrl: [],
          accessoryUrl: [],
          activityPlace: "",
        };
        self.clickLeftFn();
        // 跳转活动列表
        uni.navigateTo({
          url: "../DJinitiateActivitiesList/index",
        });
      }
    },

    filterTime() {
      // #ifdef APP-PLUS
      if (plus.os.name == "iOS") {
        time = new Date().replaceAll("-", "/");
      }
      // #endif
      let time = Date.parse(timestampToTime());
      return time;
    },

    // 保存草稿
    saveDraft(e) {
      if (this.personnel.length) {
        this.baseFormData.participant = this.personnel;
      }

      if (this.baseFormData.activityType == "") {
        this.uniShowToast("请选择活动类型");
        return;
      } else if (!this.baseFormData.activityTheme) {
        this.uniShowToast("请输入活动主题");
        return;
      } else if (!this.baseFormData.activityStartTime) {
        this.uniShowToast("请选择开始时间");
        return;
      } else if (!this.baseFormData.activityEndTime) {
        this.uniShowToast("请选择结束时间");
        return;
      } else if (this.baseFormData.activityPlace == "") {
        this.uniShowToast("请选择活动地点");
        return;
      } else if (!this.baseFormData.participant.length) {
        this.uniShowToast("请选择参与人员");
        return;
      } else if (this.baseFormData.activityContent == "") {
        this.uniShowToast("请输入活动内容");
        return;
      } else if (!this.baseFormData.accessoryUrl.length) {
        this.uniShowToast("请上传附件");
        return;
      }

      let self = this;

      uni.showModal({
        title: "提示",
        content: "请检查开始和结束时间，是否需要修改？",
        success: function (res) {
          if (res.confirm) {
            return;
          } else if (res.cancel) {
            self.subInputInfo(e);
          }
        },
      });
    },

    clickLeftFn() {
      uni.removeStorage({
        key: "participant",
      });
    },

    clickRightFn() {
      uni.navigateTo({
        url: "../DJinitiateActivitiesList/index",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
@import "/static/dangjian.scss";
/* 标题 */
.title {
  color: #000;
}
/* 提示信息 */
.placeholder {
  color: #999;
}
/* 填入信息 */
.input_contain {
  color: #333;
}
page {
  background: #fff !important;
  font-size: 28rpx !important;
}

::v-deep .uniui-calendar {
  margin-left: 20rpx;
}

::v-deep .uni-input-placeholder,
::v-deep .uni-select__input-placeholder,
::v-deep .uni-select__input-text,
.join_peo text,
::v-deep .uni-input-input {
  color: #999 !important;
  font-size: 28rpx !important;
}

::v-deep .uni-popper__arrow {
  left: 80% !important;
}

::v-deep .uni-forms-item__label {
  font-size: 32rpx !important;
  color: #000 !important;
}

/* 参与人员 1 */
.people_text {
  width: 700rpx;
  min-height: 90rpx;
  padding: 8rpx;
  box-sizing: border-box;
  background: #f3f5f8;
  border-radius: 8rpx;
  border: 1rpx solid #d6dbe3;
  font-size: 30rpx;
  display: flex;
  flex-wrap: wrap;
}

.people_text view {
  color: #999;
  min-width: 90rpx;
  margin-right: 16rpx;
}

// 封面
.cover_img {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: right;
  .upload_btn {
    background: #f3f5f8;
    border-radius: 8rpx;
    float: right;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .upload_btn .upload_text {
    width: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;
    transform: translate(-50%, -50%);
  }

  .upload_btn .upload_text view {
    width: 110% !important;
  }
}

/* 上传文件 */
.upload_file {
  margin-top: 120rpx;
  display: flex;
  height: 80rpx;
  justify-content: space-between;
}

::v-deep .uni-checkbox-input {
  border-radius: 50%;
  width: 32rpx;
  height: 32rpx;
}

/* 参与人员 2 */

.form_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.container {
  background: #fff;
}

.container-item {
  width: 700rpx;
  margin: 0 auto;
}

.btns {
  width: 700rpx;
  display: flex;
  align-items: center;
  justify-content: space-between !important;
}

.btns button {
  width: 320rpx;
  height: 70rpx;
  line-height: 70rpx;
  border-radius: 10rpx;
  text-align: center;
  color: #fff;
  font-size: 32rpx;
}

.save-draft {
  margin-left: -2rpx;
  background: #f8b86d;
}

.publish {
  margin-right: -2rpx;
  background: #0b847b;
}

.file_list {
  width: 700rpx;
  height: 80rpx;
  padding: 4rpx 20rpx;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f5f8;
  border-radius: 8rpx;
  border: 1px solid #d6dbe3;
  margin-top: 14rpx;
  .file_list_item {
    display: flex;
    align-items: center;
    color: #0b847b;
    width: 96%;

    view {
      width: 96%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

/* 预览图片 */
.cover_pic {
  width: 200rpx;
  height: 132rpx;
  position: absolute;
  right: 0;
  .coverUrl {
    position: relative;
    .change_btn {
      position: absolute;
      z-index: 99;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      .icon-xiangji1fill,
      .change_text {
        color: #fff;
        font-size: 24rpx;
      }
      .icon-xiangji1fill {
        font-size: 38rpx;
      }
    }
  }
  image {
    border-radius: 8rpx;
    width: 200rpx;
    height: 132rpx;
  }
}

/* 参与人员 */
.join_peo {
  position: absolute;
  right: 0;
  width: 150rpx;
  height: 70rpx;
  border-radius: 10rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10rpx;
  box-sizing: border-box;
  font-size: 24rpx;
  color: #333;
}

.picker_views {
  position: absolute;
  z-index: 100;
  top: 100rpx;
  width: 100%;
  height: 350rpx;
  background: #fff;
  border-radius: 8rpx;
  border: 2rpx solid #e5e5e5;
  text-align: center;
}
.upload_btn {
  width: 100%;
  text-align: center;
  background: red;
  width: 200rpx;
  height: 132rpx;
  float: right;
}

.upload_img {
  padding-top: 20rpx;
  box-sizing: border-box;
  width: 200rpx;
  height: 140rpx;
  background-color: rgba(214, 219, 227, 0.6);
  color: #0b847b;
  text-align: center;
}

.upload_img i {
  display: inline-block;
}

/* 活动内容 */
.textarea_con {
  margin-bottom: 20rpx;
  width: 700rpx;
  min-height: 220rpx;
  position: relative;
}

.text_num {
  position: absolute;
  right: 8rpx;
  bottom: 10rpx;
  font-size: 30rpx;
  color: #999;
}

.textarea_text {
  margin: 0 auto;
  width: 700rpx;
  min-height: 220rpx;
  background: #f3f5f8 !important;
  border-radius: 8rpx;
  border: 1rpx solid #d6dbe3;
  padding: 20rpx;
  box-sizing: border-box;
}

.textarea_plac {
  font-size: 30rpx;
  font-weight: 500;
  color: #333;
}

/* 重置样式 */
::v-deep .is-input-border,
::v-deep .uni-select,
::v-deep .uni-date-x--border {
  text-align: right;
  border: none !important;
}

::v-deep .uni-date {
  position: absolute;
  right: 0;
  /* 		width: 400rpx; */
}

::v-deep .icon-xiangxia1:before {
  content: "&#xe603;" !important;
}

::v-deep .uniui-calendar {
  position: absolute;
  right: 0;
}

::v-deep .uni-date-editor--x {
  text-align: right !important;
  padding-right: 5rpx;
}

/* 封面上传控件 */
::v-deep .file-picker__box {
  position: absolute !important;
  right: 0 !important;
  width: 200rpx !important;
  height: 132rpx !important;
}

::v-deep .file-picker__box-content {
  border: none !important;
}

::v-deep .uni-select__input-text,
::v-deep .uni-textarea-textarea {
  color: #999 !important;
  font-size: 28rpx;
}
</style>
